﻿<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <components>
    <component id="InMemorySubscriptionRepository"
               service="MassTransit.Subscriptions.ISubscriptionRepository, MassTransit"
               type="MassTransit.Subscriptions.InMemorySubscriptionRepository, MassTransit"/>

    <component id="SubscriptionServiceCache"
               service="MassTransit.Subscriptions.ISubscriptionCache, MassTransit"
               type="MassTransit.Subscriptions.LocalSubscriptionCache, MassTransit"/>

    <component id="SubscriptionService"
               type="MassTransit.Subscriptions.SubscriptionService, MassTransit">
      <parameters>
        <bus>${subscriptions}</bus>
        <subscriptionCache>${SubscriptionServiceCache}</subscriptionCache>
      </parameters>
    </component>
  </components>
  <facilities>
    <facility id="masstransit">

      <bus id="subscriptions"
				   endpoint="loopback://localhost/pubsub_sb">
        <subscriptionCache mode="local" name="SubscriptionServiceCache" />
        <dispatcher minThreads="1" maxThreads="4" />
      </bus>
      <bus id="local"
				   endpoint="loopback://localhost/local_sb">
        <subscriptionCache mode="local" />
        <subscriptionService endpoint ="loopback://localhost/pubsub_sb" />
        <dispatcher minThreads="1" maxThreads="4" />
      </bus>
      <bus id="remote" 
           endpoint="loopback://localhost/remote_sb">
        <subscriptionCache mode="local" />
        <subscriptionService endpoint ="loopback://localhost/pubsub_sb" />
        <dispatcher minThreads="1" maxThreads="4" />
      </bus>
      <transports>
        <transport>MassTransit.Transports.LoopbackEndpoint, MassTransit</transport>
      </transports>
    </facility>
  </facilities>
</configuration>